{template 'common/header'}
{php load()->func('tpl')}
<style>
.photo_list{padding:15px 0;}
.photo_list .alert{width:auto; margin-top:10px; overflow:hidden;}
.photo_list .photo_preview{width:130px;}
.photo_list .photo_preview img{width:130px; margin-bottom:5px;}
.photo_list .photo_preview label{padding:0;}
.photo_list .photo_preview input[type="radio"]{margin-left:0; margin-right:10px;}
.photo_list table{margin-left:40px;}
.photo_list table th,.photo_list table td{padding-bottom:5px;}
.photo_list table th{width:60px; font-size:14px;}
.photo_list table input,.photo_list table select{margin-bottom:0;}
</style>
<div class="main">
<ul class="nav nav-tabs">
    <li{if $_GPC['do'] == 'manager'} class="active"{/if}><a href="{php echo $this->createWebUrl('manager');}">喜帖管理</a></li>
	<li{if $_GPC['do'] == 'add'} class="active"{/if}><a href="{php echo $this->createWebUrl('add');}">添加喜帖</a>
</ul>
<div class="main">
	<form class="form-horizontal form" action="" method="post" enctype="multipart/form-data" onsubmit="return validate(this);">
		<input type="hidden" name="id" value="{$item['id']}">
		<div class="panel panel-default">
			<div class="panel-heading">
				喜帖基本信息
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">喜帖标题</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text" class="form-control" placeholder="" name="title" value="{$item['title']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">喜帖封面</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_image('art_pic',$item['art_pic'])}
						<input type="hidden" name="art_pic_old" value="{$item['art_pic']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">喜帖背景</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_image('bg_pic',$item['bg_pic'])}
						<input type="hidden" name="bg_pic_old" value="{$item['bg_pic']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">开场动画</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_image('donghua_pic', $item['donghua_pic'], $this->geturl(2))}
						<input type="hidden" name="donghua_pic_old" value="{$item['donghua_pic']}" />
						<span class="help-block">上传400*400左右的新郎新娘合影图,用于喜帖打开时的动画中,图片大小不超过300K</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">缩略图</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_image('suolue_pic', $item['suolue_pic'], $this->geturl(2))}
						<input type="hidden" name="suolue_pic_old" value="{$item['suolue_pic']}" />
						<span class="help-block">默认40x40,显示在喜帖主页</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">背景音乐</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_audio('music', $item['music'])}
						<input type="hidden" name="music_old" value="{$item['music']}" />
						<span class="help-block">默认40x40,显示在喜帖主页</span>
					</div>
				</div>


				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">新郎名字</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text" class="form-control" placeholder="" name="xl_name" value="{$item['xl_name']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">新娘名字</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text" class="form-control" placeholder="" name="xn_name" value="{$item['xn_name']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-xs-12 col-sm-9">
						<label class="radio-inline"><input type="radio" name="is_front"  value="1" checked="checked" />新郎在前</label>
						<label class="radio-inline"><input type="radio" name="is_front"  value="2" />新娘在前</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">联系电话</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text" class="form-control" placeholder="" name="tel" value="{$item['tel']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">婚宴日期</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_date('hy_time', !empty($item['hy_time']) ? $item['hy_time'] : date('Y-m-d H:i'), 1)}
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">喜帖视频</label>
					<div class="col-xs-12 col-sm-9">
						<textarea id="video" name="video"  class="form-control">{$item['video']}</textarea>
						<div class="help-block">请填写优酷、腾讯等视频网站的通用代码</div>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">设置转发标题</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text"  name="sendtitle" value="{$item['sendtitle']}"  class="form-control" />
						<div class="help-block">转发给朋友时显示的标题</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">设置转发描述</label>
					<div class="col-xs-12 col-sm-9">
						<textarea class="form-control" name="senddescription" cols="70">{$item['senddescription']}</textarea>
						<div class="help-block">转发给朋友时显示的描述</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">婚纱图片</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_multi_image('thumbs',$hslists)}
						<div class="help-block">建议尺寸：宽720像素，高350像素</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">密码</label>
					<div class="col-xs-12 col-sm-9">
						<input type="text" id="pwd" name="pwd" value="{$item['pwd']}"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">想说的话</label>
					<div class="col-xs-12 col-sm-9">
						<textarea style="height:100px;" class="richtext-clone" name="word" cols="70" id="word">{$item['word']}</textarea>
						<div class="help-block">这里内容会显示在微信图文回复的描述项里</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">婚宴地址</label>
					<div class="col-xs-12 col-sm-9">
						<div class="input-append"><input type="text" name="hy_addr" value="{$item['hy_addr']}"  class="form-control" /></div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">地区</label>
					<div class="col-xs-12 col-sm-9">
						{php echo tpl_form_field_district('district',array('province'=>$item['province'],'city'=>$item['city'],'dist'=>$item['dist']))}
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">坐标</label>
					<div class="col-xs-12 col-sm-9" style="padding-left:15px;">
						{php echo tpl_form_field_coordinate('baidumap', $item)}
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">页面版权设置</label>
					<div class="col-xs-12 col-sm-9">
						<textarea style="height:100px;" class="richtext-clone" name="copyright" cols="70" id="copyright">{$item['copyright']}</textarea>
						<div class="help-block">这里内容会显示在微信图文回复的描述项里</div>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
	</div>
</div>

<script type="text/javascript">
	require(['util'],function(util){
		util.editor($('#word')[0]);
		util.editor($('#copyright')[0]);
	})
</script>